import qs from "qs";
//统一管理项目接口地址
import request from "@/request/request";

//请求精品数据 axios.get(url[,config])
export const JingPinAPI = () =>
  request.get("/products/recommend", {
    headers: {
      token: "xxx",
    },
  });
//请求热门兑换数据
export const ReMenAPI = () =>
  request.get("/products/hot", {
    headers: {
      token: "xxx",
    },
  });

//获取验证码
//params { phone:13455556666,XXX }
//axios.post(url[,data])
//post给后台的参数，需要qs.stringify() 转换。
export const SendSMSAPI = (params) =>
  request.post("/sendSMS", qs.stringify(params));

//登录请求
export const PhoneReginAPI = (params) => {
  return request.post("/phoneRegin", qs.stringify(params));
};
//微信扫码登录请求
export const WeiXinLoginAPI = (params) => {
  return request.post("/wechatUsers/PCLogin", qs.stringify(params));
};
//手机号关联微信
export const BindingAPI = (params) => {
  return request.post("/wechatUsers/binding", qs.stringify(params));
};
// 请求热门游记信息
export const HotListAPI = (num) =>
  request.get(`/travels/query?orderType=${num}`);

// 请求轮播图
export const BannerAPI = () => request.get("/index/banners/travel");

// 请求攻略列表
export const StrategiesIndexAPI = (params) =>
  request.get(`/strategies/query?currentPage=${params}`);

// 请求旅游攻略详情页
export const StrategiesDetailAPI = (id) =>
  request.get(`/strategies/detail?id=${id}&name=jiayang`);
